{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Speed difference between reading numerical data from plain CSV vs. using _.npy_ file format"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [],
   "source": [
    "n_samples=1000000"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('fdata.txt', 'w') as fdata:\n",
    "    for _ in range(n_samples):\n",
    "        fdata.write(str(10*np.random.random())+',')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[0.32614787 6.84798256 2.59321025 ... 5.02387324 1.04806225 2.80646522]\n",
      " [0.42535168 3.77882315 0.91426996 ... 8.43664343 5.50435042 1.17847223]\n",
      " [1.79458482 5.82172793 5.29433626 ... 3.10556071 2.90960252 7.8021901 ]\n",
      " ...\n",
      " [3.04453929 1.0270109  8.04185826 ... 2.21814825 3.56490017 3.72934854]\n",
      " [7.11767505 7.59239626 5.60733328 ... 8.33572855 3.29231441 8.67716649]\n",
      " [4.2606672  0.08492747 1.40436949 ... 5.6204355  4.47407948 9.50940101]]\n",
      "\n",
      "Shape:  (1000, 1000)\n",
      "Time took to read: 2.671266555786133 seconds.\n"
     ]
    }
   ],
   "source": [
    "t1=time.time()\n",
    "array_direct = np.fromfile('fdata.txt',dtype=float, count=-1,sep=',').reshape(1000,1000)\n",
    "t2=time.time()\n",
    "print(array_direct)\n",
    "print('\\nShape: ',array_direct.shape)\n",
    "print(f\"Time took to read: {t2-t1} seconds.\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[0.32614787 6.84798256 2.59321025 ... 5.02387324 1.04806225 2.80646522]\n",
      " [0.42535168 3.77882315 0.91426996 ... 8.43664343 5.50435042 1.17847223]\n",
      " [1.79458482 5.82172793 5.29433626 ... 3.10556071 2.90960252 7.8021901 ]\n",
      " ...\n",
      " [3.04453929 1.0270109  8.04185826 ... 2.21814825 3.56490017 3.72934854]\n",
      " [7.11767505 7.59239626 5.60733328 ... 8.33572855 3.29231441 8.67716649]\n",
      " [4.2606672  0.08492747 1.40436949 ... 5.6204355  4.47407948 9.50940101]]\n",
      "\n",
      "Shape:  (1000, 1000)\n",
      "Time took to read: 1.018733024597168 seconds.\n"
     ]
    }
   ],
   "source": [
    "t1=time.time()\n",
    "with open('fdata.txt','r') as fdata:\n",
    "    datastr=fdata.read()\n",
    "lst = datastr.split(',')\n",
    "lst.pop()\n",
    "array_lst=np.array(lst,dtype=float).reshape(1000,1000)\n",
    "t2=time.time()\n",
    "print(array_lst)\n",
    "print('\\nShape: ',array_lst.shape)\n",
    "print(f\"Time took to read: {t2-t1} seconds.\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [],
   "source": [
    "np.save('fnumpy.npy',array_lst)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[0.32614787 6.84798256 2.59321025 ... 5.02387324 1.04806225 2.80646522]\n",
      " [0.42535168 3.77882315 0.91426996 ... 8.43664343 5.50435042 1.17847223]\n",
      " [1.79458482 5.82172793 5.29433626 ... 3.10556071 2.90960252 7.8021901 ]\n",
      " ...\n",
      " [3.04453929 1.0270109  8.04185826 ... 2.21814825 3.56490017 3.72934854]\n",
      " [7.11767505 7.59239626 5.60733328 ... 8.33572855 3.29231441 8.67716649]\n",
      " [4.2606672  0.08492747 1.40436949 ... 5.6204355  4.47407948 9.50940101]]\n",
      "\n",
      "Shape:  (1000, 1000)\n",
      "Time took to load: 0.009010076522827148 seconds.\n"
     ]
    }
   ],
   "source": [
    "t1=time.time()\n",
    "array_reloaded = np.load('fnumpy.npy')\n",
    "t2=time.time()\n",
    "print(array_reloaded)\n",
    "print('\\nShape: ',array_reloaded.shape)\n",
    "print(f\"Time took to load: {t2-t1} seconds.\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[0.32614787 6.84798256 2.59321025 ... 3.01180325 2.39479796 0.72345778]\n",
      " [3.69505384 4.53401889 8.36879084 ... 9.9009631  7.33501957 2.50186053]\n",
      " [4.35664074 4.07578682 1.71320519 ... 8.33236349 7.2902005  5.27535724]\n",
      " ...\n",
      " [1.11051629 5.43382324 3.86440843 ... 4.38217095 0.23810232 1.27995629]\n",
      " [2.56255361 7.8052843  6.67015391 ... 3.02916997 4.76569949 0.95855667]\n",
      " [6.06043577 5.8964256  4.57181929 ... 5.6204355  4.47407948 9.50940101]]\n",
      "\n",
      "Shape:  (10000, 100)\n",
      "Time took to load: 0.010006189346313477 seconds.\n"
     ]
    }
   ],
   "source": [
    "t1=time.time()\n",
    "array_reloaded = np.load('fnumpy.npy').reshape(10000,100)\n",
    "t2=time.time()\n",
    "print(array_reloaded)\n",
    "print('\\nShape: ',array_reloaded.shape)\n",
    "print(f\"Time took to load: {t2-t1} seconds.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Speed enhancement as the sample size grows..."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Array shape: (100000,)\n",
      "Array shape: (100000,)\n",
      "Processing done for 100000 samples\n",
      "\n",
      "Array shape: (200000,)\n",
      "Array shape: (200000,)\n",
      "Processing done for 200000 samples\n",
      "\n",
      "Array shape: (300000,)\n",
      "Array shape: (300000,)\n",
      "Processing done for 300000 samples\n",
      "\n",
      "Array shape: (400000,)\n",
      "Array shape: (400000,)\n",
      "Processing done for 400000 samples\n",
      "\n",
      "Array shape: (500000,)\n",
      "Array shape: (500000,)\n",
      "Processing done for 500000 samples\n",
      "\n",
      "Array shape: (600000,)\n",
      "Array shape: (600000,)\n",
      "Processing done for 600000 samples\n",
      "\n",
      "Array shape: (700000,)\n",
      "Array shape: (700000,)\n",
      "Processing done for 700000 samples\n",
      "\n",
      "Array shape: (800000,)\n",
      "Array shape: (800000,)\n",
      "Processing done for 800000 samples\n",
      "\n",
      "Array shape: (900000,)\n",
      "Array shape: (900000,)\n",
      "Processing done for 900000 samples\n",
      "\n",
      "Array shape: (1000000,)\n",
      "Array shape: (1000000,)\n",
      "Processing done for 1000000 samples\n",
      "\n"
     ]
    }
   ],
   "source": [
    "n_samples=[100000*i for i in range(1,11)] \n",
    "time_lst_read=[]\n",
    "time_npy_read=[]\n",
    "\n",
    "for sample_size in n_samples:\n",
    "    with open('fdata.txt', 'w') as fdata:\n",
    "        for _ in range(sample_size):\n",
    "            fdata.write(str(10*np.random.random())+',')\n",
    "\n",
    "    t1=time.time()\n",
    "    with open('fdata.txt','r') as fdata:\n",
    "        datastr=fdata.read()\n",
    "    lst = datastr.split(',')\n",
    "    lst.pop()\n",
    "    array_lst=np.array(lst,dtype=float)\n",
    "    t2=time.time()\n",
    "    time_lst_read.append(1000*(t2-t1))\n",
    "    print(\"Array shape:\",array_lst.shape)\n",
    "\n",
    "    np.save('fnumpy.npy',array_lst)\n",
    "\n",
    "    t1=time.time()\n",
    "    array_reloaded = np.load('fnumpy.npy')\n",
    "    t2=time.time()\n",
    "    time_npy_read.append(1000*(t2-t1))\n",
    "    print(\"Array shape:\",array_reloaded.shape)\n",
    "    \n",
    "    print(f\"Processing done for {sample_size} samples\\n\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/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V17k7kOjeVfGdbsHycy47rrrat/feeedzJkzp03rMGPGDJ588slW38/YsWPrvZnOa6+9xpAhQxg+fDiVlZWtWoc333yTU089lczMTLKzs5k5cya7du1iy5YtfO973+P4449n8ODBfPe73wXgmGOOoaSkpM42rrnmGu64445WraeItF8FxWXkLVlNWUUlDpRVVJK3ZDUFxQe8ItyqOsS90AuKyzjl9pcYcP2znHL7Sy3S2J07d2bJkiVs27atSevv2bOn4YVaQGvuZ+HCheTl5bFq1SrS0tJabZ9btmzh3HPP5Y477qCkpITi4mImTJjA559/zk033cQZZ5zBW2+9xdq1a7n99tsBmDp1KosWLardxt69e3nyySeZOnVqi9ZNRDqO/MISKquq65RVVlWTX1hygDVaV7sP8Nb6i6lTp05ceuml3H333fvN++ijjzj99NPJyspi/PjxfPLJJ0DsjPmyyy7jxBNPZPbs2cyZM4fp06czZswY+vXrx5IlS5g9ezbDhg1jwoQJVFVVAXDrrbcycuRIhg4dyqWXXkpDnRdjx47lmmuuIScnh3vvvZfy8nJ+8IMfMHLkSEaOHMmf/vQnIHZWO3r0aLKzszn55JNrz1grKyuZOnUqgwYN4uyzz6737PrXv/41ixcv5sYbb+TCCy/klVdeYcyYMUycOJHBgwcDcNdddzF06FCGDh3KPffcU9s2xx13HDNmzODYY4/lwgsvZNmyZZxyyikMHDiQN998c7993XfffUyfPp3Ro0fXlp1zzjn07NmTzZs306fPV+Mjs7KyADj//PP57W9/W1v+6quv0q9fP/r16/e1bSciciCbKurvaTxQeWtr9wHemn8xXXHFFSxcuJAdO3bUKf/JT37C9OnTefvtt7nwwgu56qqraueVlpby5z//mbvuuguA999/n5deeomlS5cybdo0xo0bx+rVq0lLS+PZZ58F4Morr2TFihWsWbOGyspKnnnmmQbr9ve//52ioiKuu+46rr76aq699lpWrFjB7373O2bOnAnAcccdx2uvvUZxcTG33norP//5zwF44IEH6Nq1K+vWreOWW25h5cqV+21/5syZTJw4kfz8fBYujH2L8K9//Sv33nsv7777LitXrmTevHm88cYbLF++nP/5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yMrKYvDgwTz44IMAzJ49m7y8PLKzs+uc+V5++eXs3LmTQYMGcdNNNx3w+vPXOeGEE5gxYwajRo3ixBNPZObMmWRnZzd6OwA9e/Zk0aJF/Ou//iuZmZkMGjSIwsJCDj/8cFauXElOTg5ZWVmMHj2amTNn1mmj888/n/Xr1zNlypQm7VtEJFlZsn8dOycnx/f9DvK6desYNGhQgmok7YmOJRFJNma20t1zGlqu3Z+Bi4iItEcKcBERkQApwEVERAKkABcREQmQAlxERCRACnAREZEAKcCbKCUlheHDhzN06FC+//3vU1FR0SLbnT9/PldeeeV+5bt37+bb3/42w4cPr/OQjlDNnTuXQYMGceGFF7J06dLap4jNmTOHO++8M8G1ExFJfp0SXYE28fZiePFW2FEKR/aB8TdB1nnN2mRaWlrtHc2mT5/Offfdxw033NASta1XzYNAavYZr7q6us791UNw//33s2zZstoniU2cODHBNRIRCUv7PwN/ezH8/irYsRHw2Ovvr4qVt5DRo0dTVvbV40nz8/MZOXIkWVlZ3HzzzbXlkydPZsSIEQwZMoSHHnqotnzevHkce+yxjBo1qvZRn/G2bt3KtGnTWLFiBcOHD+f999+nf//+/OxnP+OEE07giSeeYNWqVZx00klkZWVx9tln83//939A7NGi1157LTk5OQwaNIgVK1YwZcoUBg4cyL/92781+NnGjh3Lz372M0aNGsWxxx5b+0CS+fPnM2nSJMaOHcvAgQO55ZZbALjppptqHx0KcMMNN+x3J7rLLruMDz74gDPPPJO77777gL0O77//PhMmTGDEiBGMGTOG9evXN1hfEZEOw92T+mfEiBG+r7Vr1+5XdkB3DXG/+Yj9f+4acvDbqMehhx7q7u579uzxc845x5977jl3dy8sLPRLLrnE9+7d69XV1X7WWWf5H//4R3d33759u7u779q1y4cMGeLbtm3zTZs2ed++fX3r1q2+e/duP/nkk/2KK67Yb38vv/yyn3XWWbXv+/Xr53fccUft+2HDhvkrr7zi7u433nijX3311e7uftppp/ns2bPd3f2ee+7xXr16+aZNm/zLL7/0jIwM37Zt29d+ztNOO81/+tOfurv7s88+6+PHj3d393nz5vk//MM/+LZt22o/z4oVK/zDDz/07Oxsd3evrq72Y445pt599OvXz8vLy2u3VfOZb775Zs/Pz3d399NPP93fffddd3dfvny5jxs37mvr2hSNOpZERNoAUOQHkY/tvwt9R2njyg9SZWUlw4cPp6ysjEGDBnHGGWcA8Pzzz/P888/X3vd7586dvPfee5x66qnMnTuXp556CoCNGzfy3nvv8emnnzJ27Fh69OgBxB4D+u677x5UHWoeGbpjxw4qKio47bTTgFiXfvyjM2u6p4cNG8aQIUPo1asXAMcccwwbN27kqKOO+tr91NxHfMSIEXUe93nGGWfUrjtlyhRef/11rrnmGo466iiKi4vZsmUL2dnZDW6/Pjt37uTPf/5znc+xe/fuRm9HRKS9av8BfmSfqPu8nvJmqLkGvmvXLnJzc7nvvvu46qqrcHfy8vL4l3/5lzrLv/LKKyxbtoy//OUvdO3albFjx7b54zvjH91Z876+x3ceaP2UlJQ6y9c8+nTf9zNnzmT+/Pl8+umn/OhHPzqoOu5r7969pKen13vNX0REOsI18PE3Qeo+z/5OTYuVt4CuXbsyd+5c/uu//os9e/aQm5vLI488ws6dOwEoKytj69at7Nixg27dutG1a1fWr1/P8uXLATjxxBP54x//yPbt26mqquKJJ55odB2OPPJIunXrVnt9+tFHH609G29NL7zwAn/729+orKykoKCAU045BYCzzz6bP/zhD6xYsYLc3NwmbfuII45gwIABte3h7rz11lstVncRkdC1/zPwmtHmLTwKPV52djZZWVk8/vjjXHTRRaxbt47Ro0cDcNhhh/Gb3/yGCRMm8OCDDzJo0CAyMzM56aSTAOjVqxdz5sxh9OjRpKenM3z48CbVYcGCBVx22WXs2rWLY445hnnz5jX588ycOZPLLruMnJyvfxjOqFGj+MEPfkBpaSnTpk2rXf4b3/gG48aNIz09vVmj4xcuXMjll1/Ov//7v1NVVcXUqVM5/vjjm7w9EZH2RI8TlSaZP38+RUVF/OpXv9pv3t69e2tHxw8cODABtTt4OpZEJNnocaKSEGvXruVb3/oW48ePT/rwFhEJWfvvQpdWMWPGDGbMmL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XqE1iWta8odj7rQRUTqEVqXdE1XdChd/tJ8CnARkXqE+DUnXVPuWNSFLiJSD3VJS7LTGbiISD3UJS3JTgEuInIA6pKWZKYudBERkQApwEVERAKkABcREQmQAlxERCRACnAREZEAKcBFREQCpAAXEREJULMC3MyuNbN3zGyNmT1uZl3MrLuZvWBm70Wv3eKWzzOzDWZWYma5za++iIhIx9TkADezDOAqIMfdhwIpwFTgeuBFdx8IvBi9x8wGR/OHABOA+80spb5ti4iIyNdrbhd6JyDNzDoBXYFNwCRgQTR/ATA5mp4ELHL33e7+IbABGNXM/YuIiHRITQ5wdy8D7gQ+ATYDO9z9eaCnu2+OFvsU6BlNZwAb4zZRGpXtx8wuNbMiMysqLy9vahVFRETareZ0oXcjdlY9AOgNHGpm0+KXcXcHvLHbdveH3D3H3XN69OjR1CqKiIi0W83pQv828KG7l7t7FbAEOBnYYma9AKLXrdHyZUDfuPX7RGUiIiLSSM0J8E+Ak8ysq5kZMB5YBywFpkfLTAeejqaXAlPNrLOZDQAGAm82Y/8iIiIdVpMfJ+rub5jZk8BfgT1AMfAQcBiw2MwuBj4GzouWf8fMFgNro+WvcPfqZtZfRESkQ7LYZerklZOT40VFRYmuhoiISJsws5XuntPQcroTm4iISICa3IUuItIYBcVl5BeWsKmikt7paczKzWRydr3fJBWRg6AAF5FWV1BcRt6S1VRWxYa9lFVUkrdkNYBCXKSJ1IUuIq0uv7CkNrxrVFZVk19YkqAaiYRPAS4irW5TRWWjykWkYQpwEWl1vdPTGlUuIg1TgItIq5uVm0laat2HD6alpjArNzNBNRIJnwaxiUirqxmoplHoIi1HAS4ibWJydoYCW6QFqQtdREQkQApwERGRACnARUREAqQAFxERCZACXEREJEAKcBERkQApwEVERAKkABcREQmQAlxERCRACnAREZEAKcBFREQCpAAXEREJkAJcREQkQApwERGRACnARUREAqQAFxERCZACXEREJEAKcBERkQApwEVERAKkABcREQmQAlxERCRACnAREZEAKcBFREQCpAAXEREJULMC3MzSzexJM1tvZuvMbLSZdTezF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ws/ei125xy+aZ2QYzKzGz3ObuW0REpKNqiTPwq4F1ce+vB15094HAi9F7zGwwMBUYAkwA7jezFERERKTRmhXgZtYHOAv4dVzxJGBBNL0AmBxXvsjdd7v7h8AGYFRz9i8iItJRNfcM/B5gNrA3rqynu2+Opj8FekbTGcDGuOVKo7L9mNmlZlZkZkXl5eXNrKKIiEj70+QAN7PvAVvdfeWBlnF3B7yx23b3h9w9x91zevTo0dQqioiItFvN+R74KcBEM/su0AU4wsx+A2wxs17uvtnMegFbo+XLgL5x6/eJykRERKSRmnwG7u557t7H3fsTG5z2krtPA5YC06PFpgNPR9NLgalm1tnMBgADgTebXHMREZEOrDXuxHY7sNjMLgY+Bs4DcPd3zGwxsBbYA1zh7tUH3oyIiIgciMUuUyevnJwcLyoqSnQ1RERE2oSZrXT3nIaW053YREREAqQAFxERCZACXEREJEAKcBERkQApwEVERAKkABcREQmQAlxERCRACnAREZEAKcBFREQC1Bq3UhWhoLiM/MISNlVU0js9jVm5mUzOrvfpsSIi0gQKcGlxBcVl5C1ZTWVV7Fb3ZRWV5C1ZDaAQFxFpIepClxaXX1hSG941KquqyS8sSVCNRETaHwW4tLhNFZWNKhcRkcZTgEuL652e1qhyERFpPAW4tLhZuZmkpabUKUtLTWFWbmaCaiQi0v5oEJu0uJqBahqFLiLSehTg0iomZ2cosEVEWpG60EVERAKkABcREQmQAlxERCRACnAREZEAKcBFREQCpAAXEREJkAJcREQkQApwERGRACnARUREAqQAFxERCZACXEREJEAKcBERkQApwEVERAKkABcREQmQAlxERCRACnAREZEANTnAzayvmb1sZmvN7B0zuzoq725mL5jZe9Frt7h18sxsg5mVmFluS3wAERGRjqg5Z+B7gOvcfTBwEnCFmQ0GrgdedPeBwIvRe6J5U4EhwATgfjNLaU7lRUREOqomB7i7b3b3v0bTnwPrgAxgErAgWmwBMDmangQscvfd7v4hsAEY1dT9i4iIdGQtcg3czPoD2cAbQE933xzN+hToGU1nABvjViuNyurb3qVmVmRmReXl5S1RRRERkXalU3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k8IC9u+UJgdLTM+rjy84H/jl8mmu5E7A5BFr9MNO+/gfMT3Qat1K59gBeB0/kqwNXGLde+RxILGNunXG3cMu2bAWyMftl3Ap4BvqP2bbH27U/dAE9Yu0bztgGdovLRQGFjP5O60NtY1LWSDbwB9HT3zdGsT4Ge0XTNf+QapVFZRjS9b3mdddx9D7ADOOprttUe3QPMBvbGlamNW84AoByYF12m+LWZHYrauEW4exlwJ/AJsBnY4e7Po/ZtLYls16OAimjZfbd10BTgbcjMDgN+B1zj7p/Fz/PYn2H6Tl8Tmdn3gK3uvvJAy6iNm60TsW7IB9w9G/iCWNdjLbVx00XXYCcR+0OpN3ComU2LX0bt2zpCbVcFeBsxs1Ri4b3Q3ZdExVvMrFc0vxewNSovA/rGrd4nKiuLpvctr7OOmXUi1t25/Wu21d6cAkw0s4+ARcDpZvYb1MYtqRQodfc3ovdPEgt0tXHL+DbwobuXu3sVsAQ4GbVva0lku24H0qNl993WQVOAt4FopOLDwDp3vytu1lKgZlTidGLXxmvKp0YjGwcAA4E3o+6ez8zspGibP9xnnZptnQO8FP1VWQh8x8y6RX/hfycqa1fcPc/d+7h7f2KDSF5y92mojVuMu38KbDSzzKhoPLAWtXFL+QQ4ycy6Ru0yHliH2re1JKxdo3kvR8vuu/+Dl+iBBR3hB/h/xLpn3gZWRT/fJXYd5EXgPWAZ0D1unRuIjX4sIRrpGJXnAGuieb/iq7vpdQGeADYQGyl5TNw6P4rKNwD/nOj2aIP2HstXg9jUxi3btsOBouhYLiA2slZt3HLtewuwPmqbR4mNhFb7Nr9dHyc2rqCKWE/SxYluV+CYaNkN0bqdG/u5dCtVERGRAKkLXUREJEAKcBERkQApwEVERAKkABcREQmQAlxERCRACnAREZEAKcBFREQC9P8BxOJVTQtXHB0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x25cda127f60>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure(figsize=(8,5))\n",
    "#plt.xscale('log')\n",
    "#plt.yscale('log')\n",
    "plt.scatter(n_samples,time_lst_read)\n",
    "plt.scatter(n_samples,time_npy_read)\n",
    "plt.legend(['Normal read from CSV','Read from .npy file'])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0.0,\n",
       " 2.5005340576171875,\n",
       " 0.0,\n",
       " 0.0,\n",
       " 15.625238418579102,\n",
       " 5.503654479980469,\n",
       " 7.005214691162109,\n",
       " 0.5002021789550781,\n",
       " 6.002664566040039,\n",
       " 9.006738662719727]"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time_npy_read"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  },
  "latex_envs": {
   "LaTeX_envs_menu_present": true,
   "autoclose": false,
   "autocomplete": true,
   "bibliofile": "biblio.bib",
   "cite_by": "apalike",
   "current_citInitial": 1,
   "eqLabelWithNumbers": true,
   "eqNumInitial": 1,
   "hotkeys": {
    "equation": "Ctrl-E",
    "itemize": "Ctrl-I"
   },
   "labels_anchors": false,
   "latex_user_defs": false,
   "report_style_numbering": false,
   "user_envs_cfg": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
